package com.example.config;

import com.example.properties.OssProperties;
import com.example.properties.SmsProperties;
import com.example.template.OssTemplate;
import com.example.template.SmsTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.time.OffsetDateTime;

@EnableConfigurationProperties({
        OssProperties.class,
        SmsProperties.class
})
public class CommonAutoConfig {
    @Bean
    public OssTemplate ossTemplate(OssProperties ossProperties) {
        return new OssTemplate(ossProperties);
    }

    @Bean
    public SmsTemplate smsTemplate(SmsProperties smsProperties) {
        return new SmsTemplate(smsProperties);
    }
}
